from Goldenberry.optimization.ga.GbInitPopMgr.InitPopGeneratorFactory import InitPopGeneratorFactory
from Goldenberry.optimization.ga.GbInitPopMgr.IInitPopMgt import IInitPopMgt
from Goldenberry.optimization.ga.GbInitPopMgr.IInitPopSetup import IInitPopSetup

class InitPop(IInitPopMgt, IInitPopSetup):
    """description of class"""

    #Override methods of IInitPopMgt
    def generate_init_pop(self, type, params, solution_domain, cand_size, var_size, range_min, range_max):
        init_pop_generator = InitPopGeneratorFactory().get_generator(type)
        population = init_pop_generator.generate_pop(params, solution_domain, cand_size, var_size, range_min, range_max)
        return population

    #Override methods of IInitPopSetup  
    def get_params(self):
        return self.init_pop_params

    def set_params(self, params):
        self.init_pop_params = params

    def get_type(self):
        return self.init_pop_type

    def set_type(self, type):
        self.init_pop_type = type


